package com.cai.seckill.config.argumentResolver;

import com.cai.seckill.pojo.User;

/**
 * @BelongsProject secKill
 * @Package com.cai.seckill.config
 * @Author Uli1024
 * @CreaterTime 2022/8/12 20:20
 */
public class UserContext {
    private static ThreadLocal<User> userHolder = new ThreadLocal<>();

    public static void setUser(User user) {
        userHolder.set(user);
    }

    public static User getUser() {
        return userHolder.get();
    }
}
